package day34;

import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2023/04/13  8:14
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String num = scanner.nextLine();
            int nums = Integer.valueOf(num);
            String[] arr = new String[nums];
            for (int i = 0; i < nums; i++) {
                arr[i] = scanner.nextLine();
            }
            System.out.println(countList(arr) );
        }
    }

    private static String countList(String[] arr) {
        if(arr == null || arr.length == 0){
            return null;
        }
        String result ="";
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].contains(",") || arr[i].contains(" ")) {
                if(i == arr.length - 1){
                    result += "\"" + arr[i] + "\"";
                }else {
                    result += "\"" + arr[i] + "\"" + "," + " ";
                }
            } else {
                if (i == arr.length - 1) {
                    result += arr[i];
                } else {
                    result += arr[i] + "," + " ";
                }
            }
        }
        return result;
    }
}
